import work.*;
public class Main {
    public static void main(String[] args) {
        Zoo zoo = new Zoo();
        zoo.addAnimal(new Elephant("大象", 200, 5, "灰色"));
        zoo.addAnimal(new Lion("狮子", "金色",3,60));
        zoo.addAnimal(new Lizard("年老蜥蜴", 30, "绿色",7,200, "南非"));
        zoo.addAnimal(new Goldfish("金鱼", 0.2, "红色"));
        Elephant testNewElephant = new Elephant();
        testNewElephant.setAge(2);
        testNewElephant.setWeight(50);
        testNewElephant.setName("小象");
        testNewElephant.setStripeColor("黑白");
        zoo.addAnimal(testNewElephant);
        System.out.println("动物园现有动物：");
        zoo.displayAnimals();


        Elephant newTiger = new Elephant("大象", 220, 6, "白色");
        zoo.updateAnimal(zoo.findAnimalByName("Tiger"), newTiger);

        System.out.println("更新后的动物园动物：");
        zoo.displayAnimals();

        newTiger.makeSound();
        // 查找打印
        Animal foundAnimal = zoo.findAnimalByName("Lion");
        if (foundAnimal != null) {
            System.out.println("找到动物：" + foundAnimal.getClass().getSimpleName());
            foundAnimal.displayDetails();
        } else {
            System.out.println("未找到指定动物。");
        }

        // 删除
        zoo.removeAnimal(zoo.findAnimalByName("Goldfish"));

        System.out.println("删除动物后的动物园：");
        zoo.displayAnimals();
        //0506test
        //again
    }
}